<%@ page contentType="text/html; charset=UTF-8" %>
<%@page import="net.lunjin.util.Constants"%>
<%@page import="net.lunjin.util.ProjectUtil"%>
<%@page import="net.lunjin.bean.News"%>
<%@page import="net.lunjin.bean.NewsRemark"%>
<%@page import="java.util.List"%>
<%@ page import="finaler.util.PageList" %>
<%@ page import="finaler.util.PageUtil" %>
<% 
News news = (News) request.getAttribute("newsDetail");
List<News> beforeAfterList = (List<News>) request.getAttribute("beforeAfterList");
PageList newsRemarkList = (PageList)request.getAttribute("newsRemarkList");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=news.getNewstitle()%>_<%=Constants.TITLE %></title>
<meta name="keywords" content="<%=Constants.METAKEYWORDS %>">
<jsp:include page="/commonImport.jsp"/>
</head>

<script>
	function checkRemarkForm(){
		if($("#rmcontent").val()==""){
			alert("评论内容不能为空!");
			$("#recontent").focus();
			return false;
		}
		if($("#nc").val()==''){
			alert("请输入验证码!");
			return false;
		}
	}
</script>

<body class="articleview">

<jsp:include page="/top.jsp"/>

<div class="channel-nav w960 center clear mt1">
	<div class='sonnav'>
		当前位置:</strong> <a href='<%=Constants.URL %>'>交易平台评测网</a> > <a href='<%=Constants.URL %>/news/type_<%=news.getNewstype()%>/'><%=ProjectUtil.getNewsType(news.getNewstype()+"") %></a> > 查看文章 
	</div>

	<div class="pleft">
		<div class="aa"></div>
		<div class="viewbox">
			<div class="title">
				<h2><%=news.getNewstitle()%></h2>
			</div><!-- /title -->
			<div class="info">
				<small>转载于</small><%=news.getCreatetime()%>  阅读:<span id="count"><%=news.getHit()%>次
				<small></small>
			</div>
			<!-- /info -->

			<div class="content">
				<table width='100%'>
					<tr>
						<td align="center">
							<jsp:include page="/WEB-INF/jsp/ad/sogoubigAd.jsp"/>
						</td>
					</tr>
					<tr>
						<td><p>　　<%=news.getNewscontent()%></p>
						</td>
					</tr>
				</table>
			</div>
			<!-- /content -->

			<div class="boxoff">
				<strong>------分隔线----------------------------</strong>
			</div>
			<div class="handle">
				<div class="context">
					<ul>
					<%
					if(beforeAfterList.size()!=0){
						for(int i=0;i<beforeAfterList.size();i++){
						News beforeAfterNews = (News) beforeAfterList.get(i);
						%>
						<li><%=i==0?"上":"下"%>一篇：<%=beforeAfterNews.getId()==null?"没有了": "<a href='"+Constants.URL +"/news/"+beforeAfterNews.getId()+".html'>"+beforeAfterNews.getNewstitle()+"</a>"%> </li>
					<%}
					}
					%>
					</ul>
				</div><!-- /context -->
			</div><!-- /handle -->
			
			<div class="context">
				<!-- 链接单元广告 -->
			</div>

			<div class="actbox">
				<ul>
					<li id="act-pnt"><a href="#" onClick="window.print();">打印</a></li>
				</ul>
			</div>
			
		</div><!-- /viewbox -->

		<div id="remarkDiv" name="remarkDiv"></div>
		<%	List newsRemarkLst = newsRemarkList.getList();
			for(int i=0;i<newsRemarkLst.size();i++){
			NewsRemark newsRemark = (NewsRemark)newsRemarkLst.get(i);
			%>
			<!--评论-->
			<div class="mt1">
				<dl class="tbox">
					<dt class='light'><strong>评论人:<%=newsRemark.getCreateuser() %>  &nbsp;&nbsp;&nbsp;评论时间:<%=newsRemark.getCreatetime() %></strong></dt>
					<dd class='light'>
						<ul class="c1 ico2">
				        	<table width="98%">
				        		<tr align="left">
				        			<Td colspan="4">&nbsp;&nbsp;&nbsp;&nbsp;<%=newsRemark.getRmcontent() %></Td>
				        		</tr>
				        	</table>
						</ul>
					</dd>
				</dl>
			</div>
			<!--/评论-->
		<%} %>
		
		<div>
			<table width="98%">
				<tr align="right">
					<td>
						<%if(newsRemarkList.getList().size()>0){%>
							<%=PageUtil.getCurrPage(newsRemarkList)%>&nbsp;
							<%=PageUtil.getRecord(newsRemarkList)%>&nbsp;
							<%=PageUtil.getSinglePaginator(newsRemarkList,false)%>
						<%} %>
					</td>
				</tr>
			</table>
		</div>
		
		<a name="comments"></a>
		
		<!-- //AJAX评论区 -->
		
		<!-- //主模板必须要引入-->
		<div class="mt1">
		  <dl class="tbox">
		    <dt> <strong>发表评论</strong> <span class="more"></span> </dt>
		    <dd>
		      <div class="left_box">
				<form action="<%=Constants.URL %>/news/remark" method="post" onsubmit="return checkRemarkForm()">
					<input type="hidden" id="newsId" name="newsId" value="<%=news.getId()%>"/>
					<table width="100%" border="0" cellspacing="1" cellpadding="0" class="defaultFont">
						<tr> 
			                <td colspan="2">
				               <textarea id="rmcontent"  name="rmcontent"  maxlength="1000" style="width:99%;height:100px" placeholder="请遵守法律，不得粗言秽语...(1000字以内)"></textarea>
				            </td>
			            </tr>
						<tr> 
			                <td colspan="2"><label for="class"><font color="red">＊</font>验证码：</label>
		        				<%=request.getAttribute("ns") %> = <input type="input" id="nc" name="nc" />
				            </td>
			            </tr>
						<tr>
							<Td><img src="<%=Constants.URL %>/images/arrow_red.gif" alt="pic" width="4" height="13"> 你的名字：<%=request.getRemoteAddr() %>
							</Td>
							<td align="right">
							<input type="submit" value="评论" class="submit" />
							</td>
						</tr>
				    </table>
			    </form>
			</div>
		    </dd>
		  </dl>
		</div>
		<!-- //评论表单区结束 -->
	<!-- //评论内容区 -->
	
	<!-- //评论内容区结束 -->
	</div><!-- //左边内容结束 -->
	
	<div class="arcpright">
		<div class="pright">
			<!-- //右边内容开始 -->	
			<div class="arcpright">
				<jsp:include page="/WEB-INF/jsp/bbs/bbsInclude.jsp"/>
				<jsp:include page="/WEB-INF/jsp/news/fmNewsInclude.jsp"/>
				<jsp:include page="/WEB-INF/jsp/company/randomCom.jsp"/>
			</div>
		</div>
	</div>
</div>

<jsp:include page="/foot.jsp"/> 

<jsp:include page="/WEB-INF/jsp/ad/bottomrightcorner.jsp"/>
</body>
</html>